<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Obtaining the Source Code</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"/><LINK
REL="HOME"
TITLE="Cygwin/X Contributor's Guide"
HREF="cygwin-x-cg.html"/><LINK
REL="UP"
TITLE="Programming"
HREF="programming.html"/><LINK
REL="PREVIOUS"
TITLE="Prerequisites for Building the Source Code"
HREF="prog-build-prerequisites.html"/><LINK
REL="NEXT"
TITLE="Native Compiling"
HREF="prog-build-native.html"/><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html;charset=utf-8"/></HEAD
><BODY
CLASS="sect1"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Cygwin/X Contributor's Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="prog-build-prerequisites.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 2. Programming</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="prog-build-native.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"/></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="prog-obtaining-source"
>Obtaining the Source Code</A
></H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="prog-source-cygwin-setup"
>Obtaining via Cygwin setup</A
></H2
><P
>&#13;The source code for the packages distributed via Cygwin setup is also
available via Cygwin setup.
To install the source for the X server, run Cygwin setup and tick the
'Src?' check-box for the 'xorg-server' package.
</P
><P
>&#13;This may have multiple patches applied on top of the upstream X.Org X Window System source code,
and is known to build and function on Cygwin, so this should be the starting
point for new developers.
</P
><P
>&#13;On installing the source code package, setup will unpack it under
/usr/src.  You should find the source archive,
any needed .patch files, and a .cygport file which automates the distribution
configuration, build and packaging tasks.
</P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
Due to the large number of patches applied to the upstream source, the current
source package contains a source archive prepared directly from a git repository
containing those patches on top of the upstream source, rather than containing
the upstream source archive and many separate patches.
</P
></BLOCKQUOTE
></DIV
><P
>&#13;The sources can unpacked and prepared using cygport as follows:
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;Username@CygwinHost ~
$ cd /usr/src

Username@CygwinHost /usr/src
$ cygport xorg-server-n.n.n-n.cygport prep
[lots of output as archive is unpacked and patches applied]

$ cygport xorg-server-n.n.n-n.cygport compile
[lots of output as source is configured and built]

Username@CygwinHost /usr/src
$ cd xorg-server-n.n.n-n/src/xorg-server-n.n.n/
[navigate to the source directory]

Username@CygwinHost /usr/src/xorg-server-n.n.n-n/src/xorg-server-n.n.n/
$
</PRE
></TD
></TR
></TABLE
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
Alternatively you may manually untar the archive and apply any patches
(in the correct order).
</P
></BLOCKQUOTE
></DIV
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
It is necessary to run the package's autogen.sh script to
regenerate the configure script and Makefiles if the patches modify the
autoconf or automake source files
</P
></BLOCKQUOTE
></DIV
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
For details of using cygport to generate packages for distribution, see
<A
HREF="prog-distribution.html"
>the Section called <I
>Packaging a Cygwin/X Distribution</I
></A
>
</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="prog-source-cygports"
>Obtaining from version control</A
></H2
><P
>&#13;The packaging script for the packages distributed via Cygwin setup
is currently held in a git repository.
Intermediate versions between released packages can be obtained from there.
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;Username@CygwinHost ~
$ git clone https://github.com/jon-turney/xorg-server-cygport.git
</PRE
></TD
></TR
></TABLE
><P
>&#13;This will obtain a .cygport file. and any .patch files.  You can then add the source archive by downloading it with cygport.
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;Username@CygwinHost ~
$ cygport xorg-server-n.n.n-n.cygport download
</PRE
></TD
></TR
></TABLE
><P
>&#13;Then proceed as in <A
HREF="prog-obtaining-source.html#prog-source-cygwin-setup"
>the Section called <I
>Obtaining via Cygwin setup</I
></A
>
</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="prog-source-xorg"
>Obtaining from X.Org</A
></H2
><P
>Cygwin/X source code is contained in, and distributed with, the
<A
HREF="http://xorg.freedesktop.org/wiki/Releases/Download"
TARGET="_top"
>&#13;X Window System source code releases</A
>.
</P
><P
>Anonymous read-only access to the
<A
HREF="http://cgit.freedesktop.org/xorg/xserver/"
TARGET="_top"
>&#13;X Window System git source
</A
>
tree hosted on
<A
HREF="http://freedesktop.org/Software/xorg"
TARGET="_top"
>freedesktop.org</A
>
is available.</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;$ git clone git://anongit.freedesktop.org/git/xorg/xserver
</PRE
></TD
></TR
></TABLE
>
</P
><P
>&#13;You will probably want to look at the .cygport file in the source
package obtained in <A
HREF="prog-obtaining-source.html#prog-source-cygwin-setup"
>the Section called <I
>Obtaining via Cygwin setup</I
></A
> and
check you understand if you need to use the configuration options
used there. For example:
</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;$ ./configure --prefix=/usr --with-log-dir=/var/log
</PRE
></TD
></TR
></TABLE
>
</P
><P
>&#13;Consult the <A
HREF="glossary.html#gloss-git"
><I
CLASS="glossterm"
>git</I
></A
> documentation
for details on using git.
</P
><P
>The CYGWIN branch exists in git for historical reasons.
Current development follows the mainline
(called the <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>master</I
></SPAN
> branch in git terminology).
</P
><P
>If you just want to look at the Cygwin/X source, use the
<A
HREF="http://cgit.freedesktop.org/xorg/xserver/"
TARGET="_top"
>&#13;cgit interface to the X.Org tree
</A
>.
Most of the Cygwin/X-specific code is in the
<A
HREF="http://cgit.freedesktop.org/xorg/xserver/tree/hw/xwin"
TARGET="_top"
>&#13;xserver/hw/xwin</A
> 
directory.
</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"/><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="prog-build-prerequisites.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cygwin-x-cg.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="prog-build-native.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Prerequisites for Building the Source Code</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="programming.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Native Compiling</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>